home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n07.arc / UNIQUE.ARC / UNIQUESM.ASM < prev    next >
Assembly Source File  |  1991-03-27  |  723b  |  51 lines

  1. cseg    segment
  2.     assume    cs:cseg, ds:cseg, es:cseg
  3.     
  4.     org    100h
  5. unique    proc    near
  6. start:    push    ds
  7. search:    mov    bx,ax        ;search backward for COMMAND.COM MCB
  8.     mov    ax,word ptr ds:[16h]
  9.     mov    ds,ax
  10.     cmp    ax,word ptr ds:[16h]
  11.     jnz    search
  12.     mov    ds,bx
  13.     mov    dx,ax
  14.     mov    ax,word ptr ds:[2Ch]
  15.     dec    ax
  16.     xor    si,si
  17. @@:    dec    ax
  18.     mov    ds,ax
  19.     cmp    byte ptr [si],4dh
  20.     jnz    @B
  21.     cmp    [si+1],dx
  22.     jnz    @B
  23.     pop    ds
  24.     inc    ax
  25.     mov    es,ax
  26.     mov    di,word ptr es:[0dh]
  27.     mov    ah,5ah
  28.     xor    cx,cx
  29.     mov    dx,offset new_name
  30.     int    21h
  31.     mov    bx,ax
  32.     mov    ah,3eh
  33.     int    21h
  34.     mov    ah,41h
  35.     int    21h
  36.     mov    si,dx
  37.     inc    si
  38.     inc    si
  39.     mov    cx,8
  40.     rep    movsb
  41.     mov    al,0dh
  42.     stosb
  43. exit:    int    20h
  44.  
  45. new_name    db    '.\'
  46.     db    9 dup(0)
  47.  
  48. unique    endp
  49. cseg    ends
  50.     end    start
  51.